1. Field of the Invention
The invention relates to the formation of instructions in a processing system and, in particular, to the formation of variable-length instructions.
2. Description of Related Art
The manipulation of data in a processing system is achieved by the use of instructions, each including an opcode portion and a parameter portion. The opcode portion specifies an operation to be performed by a processor in the system and the parameter portion includes one or more parameters representing data such as addresses for locating data in a memory and/or numbers to be manipulated by the processor.
In any instruction including one or more parameters representing an address, the total bit length must be large enough to represent the largest-possible address value. A common technique for reducing this bit length is to use address indexing, whereby a variety of instructions with different length address parameters are provided. For example, a variety of JUMP instructions with different length offset parameters and requiring different numbers of bytes may be provided.
Similarly, in any instruction including one or more parameters representing numbers to be manipulated by the processor, the total bit length must be large enough to represent the largest possible values of the numbers. Typically, a processing system has a variety of memories (registers, ROM, RAM etc.) of differing bit-length capacities and is capable of moving numbers of a variety of different bit lengths. In order to facilitate this, it is common practice to provide a different MOVE instruction for each possible combination of bit lengths. For example, even in the situation where all memory capacities are identical (e.g. a thirty-two bit capacity), four different MOVE instructions might be required, i.e.:                a first MOVE instruction for moving an eight-bit number to a thirty-two-bit-capacity memory location;        a second MOVE instruction for moving a sixteen-bit number to a thirty-two-bit-capacity memory location;        a third MOVE instruction for moving a twenty-four-bit number to a thirty-two-bit-capacity memory location; and        a fourth MOVE instruction for moving a thirty-two-bit number to a thirty-two-bit-capacity memory location.In the first three examples, the processor will automatically expand the moved word to a thirty-two-bit value.        